<template>
  <div class="WCon bgcolor3">
    <!-- <mt-header ref="head" fixed :title="$route.name">
      <router-link v-if="$route.meta.left&&$route.meta.left.isHide" to="/" slot="left">
        <mt-button icon="back" @click="back()">返回</mt-button>
      </router-link>
      <mt-button
        v-if="$route.meta.right&&$route.meta.right.isHide"
        icon="more"
        slot="right"
        @click="dlgType(1)"
        :class="$route.meta.right&&$route.meta.right.className"
      >{{$route.meta.right&&$route.meta.right.txt}}</mt-button>
    </mt-header>
    <router-view ref="contentWrap" :style="footStyle" class="page-component-wrap"></router-view>
    <foot-Tab :selectedVal="selectedVal" ref="foot"></foot-Tab> -->
  </div>
</template>

<script>
import footTab from '@/components/footTab'
import { znk } from '@/util/public'
import {
  // mapActions,
  mapGetters
  // mapState
} from 'vuex'
export default {
  components: { 'foot-Tab': footTab },
  data () {
    return {
      selectedVal: null,
      footStyle: {
        'padding-top': null,
        'padding-bottom': null
      }
    }
  },
  mounted () {
    this.selectedVal = this.$route.meta.tab
    this.footStyle['padding-top'] = this.$refs.head.$el.offsetHeight + 'px'
    this.footStyle['padding-bottom'] = this.$refs.foot.$el.offsetHeight + 'px'
    console.log('this', this, this.footStyle.marginBottom)
  },
  methods: {
    back () {
      // console.log(this.$route.meta)
      this.$router.back(-1)
    },
    dlgType (index) {
      if (!znk.getCookie('token')) {
        this.$router.push({
          path: '/aiyu/login'
        })
      } else {
        this.$router.push({
          path: '/aiyu/account'
        })
      }
    }
  },
  computed: {
    ...mapGetters(['userinfo', 'loading'])
  },
  watch: {
    '$route': {
      handler (val) {
        this.selectedVal = this.$route.meta.tab
        // console.log('-----', val)
      }
    }
  }
}
</script>
<style>
html,
body,
#app,
.WCon {
  height: 100%;
}
</style>
